home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / var / lib / dpkg / info / python.postinst < prev    next >
Text File  |  2009-10-30  |  1KB  |  48 lines

  1. #! /bin/sh -e
  2.  
  3. new_config_file()
  4. {
  5.     cat > /etc/python/debian_config <<-EOF
  6.     [DEFAULT]
  7.     # how to byte-compile (comma separated: standard, optimize)
  8.     byte-compile = standard
  9.     EOF
  10. }
  11.  
  12. case "$1" in
  13.     configure)
  14.     [ -d /etc/python ] || mkdir /etc/python
  15.     [ -f /etc/python/debian_config ] || new_config_file
  16.  
  17.         if [ -n "$2" ] && dpkg --compare-versions $2 lt 2.6.1-0ubuntu1; then
  18.         oldv=$(echo $2 | sed 's/^\(...\).*/\1/')
  19.         if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
  20.         echo "running python rtupdate hooks for python2.6..."
  21.         fi
  22.         for hook in /usr/share/python/runtime.d/*.rtupdate; do
  23.         [ -x $hook ] || continue
  24.         if ! $hook rtupdate python$oldv python2.6; then
  25.             hb=$(basename $hook .rtupdate)
  26.             echo >&2 "error running python rtupdate hook $hb"
  27.             errors=yes
  28.         fi
  29.         done
  30.         [ -z "$errors" ] || exit 4
  31.  
  32.         if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
  33.         echo "running python post-rtupdate hooks for python2.6..."
  34.         fi
  35.         for hook in /usr/share/python/runtime.d/*.rtupdate; do
  36.         [ -x $hook ] || continue
  37.         if ! $hook post-rtupdate python$oldv python2.6; then
  38.             hb=$(basename $hook .rtupdate)
  39.             echo >&2 "error running python post-rtupdate hook $hb"
  40.             errors=yes
  41.         fi
  42.         done
  43.         [ -z "$errors" ] || exit 5
  44.         fi
  45. esac
  46.  
  47.  
  48.